package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.widget.LineImageView;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import o.cgz;
import o.chc;
import o.chy;
import o.dof;
import o.ContentManager;
import o.eia;
import o.epv;
import o.eqx;
import o.evx;
import o.ewm.d;
import o.ewm.h;
import o.ewm.j;

public class HorizonalBilobaItemCard extends BaseHorizontalItemCard {
    private RelativeLayout ʼ;
    private TextView ʽ;
    private LineImageView ˋ;

    public HorizonalBilobaItemCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (LineImageView) view.findViewById(j.ˏˎ);
        this.ʽ = (TextView) view.findViewById(j.ㆍʼ);
        this.ʼ = (RelativeLayout) view.findViewById(j.ⵗॱ);
        ʽ(view);
        ʼ();
        return this;
    }

    private void ʼ() {
        int ˎ = epv.ˎ(this.ʼॱ, ॱॱ(), chc.ˋ());
        int i = ˎ / 2;
        if (this.ˋ != null) {
            this.ˋ.setBorderRadius(8);
            LayoutParams layoutParams = this.ʼ.getLayoutParams();
            layoutParams.width = ˎ;
            layoutParams.height = i;
            this.ʼ.setLayoutParams(layoutParams);
        }
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (!dof.ˋ(cardBean.ॱˌ())) {
            Context ˋ = ContentManager.getInstant().getContext();
            eqx.ˋ(ˋ.getResources().getDimensionPixelSize(d.ـ), ˋ.getResources().getDimensionPixelSize(d.ॱͺ), this.ˋ, cardBean.ॱˌ());
        }
        if (cardBean instanceof eia) {
            ˋ(this.ʽ, ((eia) cardBean).ˋʻ());
        }
    }

    public int ˊ() {
        return h.ˋᶥ;
    }

    public int ˎ() {
        return h.ˋᶥ;
    }

    public void ॱ(final chy o_chy) {
        OnClickListener anonymousClass2 = new evx(this) {
            final /* synthetic */ HorizonalBilobaItemCard ˎ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ˎ);
            }
        };
        this.ˋ.setOnClickListener(anonymousClass2);
        ˉ().setOnClickListener(anonymousClass2);
    }

    public int ॱॱ() {
        return chc.ʼॱ();
    }
}
